<#include "header.htm"/>
<link rel="alternate" type="application/rss+xml" title="RSS" href="${contextPath}/rss/forums${extension}" />


<p class="right rightside">${I18n.getMessage("ForumListing.date")} ${now}</p>
   <#if logged>
        <p>${I18n.getMessage("ForumListing.lastVisit")}: ${lastVisit}
        <#if canAccessModerationLog?default(false)>
            <br />[&nbsp;<a href="${JForumContext.encodeURL("/moderation/showActivityLog")}">${I18n.getMessage("ModerationLog.moderationLog")}</a>&nbsp;]
        </#if>
        </p>
        
   </#if>
   <ul class="linklist">
	 <li>
	    <a href="${JForumContext.encodeURL("/recentTopics/list")}">${I18n.getMessage("ForumBase.recentTopics")}</a> &bull; 
	    <a href="${JForumContext.encodeURL("/hottestTopics/list")}">${I18n.getMessage("ForumBase.hottestTopics")}</a>
	 </li>

     <li class="rightside">
     <#if logged>
        <a href="${JForumContext.encodeURL("/forums/newMessages")}">${I18n.getMessage("ForumListing.readLastVisitMessages")}</a>
     </#if>
    </li>
</ul>






<#list allCategories as category>


		<div class="forabg">
			<div class="inner"><span class="corners-top"><span></span></span>
			<ul class="topiclist">
				<li class="header">
					<dl class="icon">
						<dt>${category.name}</dt>
						<dd class="topics">${I18n.getMessage("ForumListing.totalTopics")}</dd>
						<dd class="posts">${I18n.getMessage("ForumListing.totalMessages")}</dd>
						<dd class="lastpost"><span>${I18n.getMessage("ForumListing.lastMessage")}</span></dd>
					</dl>
				</li>
			</ul>
			<ul class="topiclist forums">
	       <#list category.getForums() as forum>
	       <#assign lpi = forumRepository.getLastPostInfo(forum.id)/>
		       <li class="row">
			       	<#if forum.unread>
							<dl class="icon" style="background-image: url(${contextPath}/templates/${templateName}/img/forum_unread.gif); background-repeat: no-repeat;">
					<#else>
							<dl class="icon" style="background-image: url(${contextPath}/templates/${templateName}/img/forum_read.gif); background-repeat: no-repeat;">
					</#if> 
			       
			       
			       
			       
			       
				   <dt title="No unread posts">
			         <a class="forumtitle" href="${JForumContext.encodeURL("/forums/show/${forum.id}")}">${forum.name?html}</a><br />
                     ${forum.description?default("")}
					 <#if forum.isModerated()>
					  <br/>
					  ${I18n.getMessage("ForumIndex.moderators")}
					  <#assign moderators = forumRepository.getModeratorList(forum.id)/>
					  <#list moderators as m>
					    <a href="${JForumContext.encodeURL("/user/listGroup/${m.id}")}">${m.name?html}</a>
					  </#list>
					 </#if>
					
				   </dt>
				   
				   <dd class="topics">${forum.totalTopics} <dfn>Topics</dfn></dd>
				   
				   
				   <#assign total = forum.totalPosts/>
				   <#if (total == 0 && forum.totalTopics > 0)>
					 <#assign total = forum.totalTopics/>
				   </#if>
				   <dd class="posts"><#if (total > 0)>${total}<#else>0</#if> <dfn>Posts</dfn></dd>
				   
				   
				   
				   <dd class="lastpost"><span>
					<#if (lpi.userId > 0)>
					<dfn>Last post</dfn> ${I18n.getMessage("by")} 
					<a href="${JForumContext.encodeURL("/user/profile/${lpi.userId}")}" class="username-coloured">${lpi.username}</a> 
					<#assign startPage = ""/>
					<#if (lpi.topicReplies + 1 > topicsPerPage)>
						<#assign startPage = ((lpi.topicReplies / topicsPerPage)?int * topicsPerPage) +"/"/>
					</#if>
					<#assign url = JForumContext.encodeURL("/posts/list/${startPage}${lpi.topicId}") + "#" + lpi.postId/>
					<a href="${url}"><img src="${contextPath}/templates/${templateName}/img/icon_topic_latest.gif" border="0" alt="[Latest Reply]" width="11" height="9" /></a>
					<br />
					${lpi.postDate}
					</span>
				    
				    <#else>
				    ${I18n.getMessage("ForumListing.noPosts")}<br>&nbsp;
				    </#if>
				    </dd>
				
				    </span>
			      </dl>
		       </li>
			</#list>
		
			</ul>

			<span class="corners-bottom"><span></span></span></div>
		</div>

</#list>

			<#if !logged && !sso>
			<form accept-charset="${encoding}" action="${JForumContext.encodeURL("/jforum")}" method="post" class="headerspace">
				<input type="hidden" name="module" value="user" />
				<input type="hidden" name="action" value="validateLogin" />
				<h3><a href="${JForumContext.encodeURL("/user/login")}">${I18n.getMessage("ForumBase.login")}</a>&nbsp; &bull; &nbsp;<a href="${JForumContext.encodeURL("/user/insert")}">${I18n.getMessage("ForumBase.register")}</a></h3>
				<fieldset class="quick-login">
				    <label for="username">${I18n.getMessage("Login.user")}:</label>&nbsp;<input type="text" name="username" id="username" size="10" class="inputbox"/>
				    <label for="password">${I18n.getMessage("Login.password")}:</label>&nbsp;<input type="password" name="password" id="password" size="10" class="inputbox"/>
				    <#if autoLoginEnabled>
					    	<label for="autologin">${I18n.getMessage("Login.autoLogon")}</label> <input class="text" type="checkbox" name="autologin" id="autologin"/>
				    </#if>
				    <input type="submit" name="login" value="${I18n.getMessage("Login.enter")}" class="button2" />
				</fieldset>
	         </form>
	         </#if>


	<h3>${I18n.getMessage("ForumListing.whoIsOnline")}</h3>
	<#assign adminColor = "class='admin'"/>
	<#assign moderatorColor = "class='moderator'"/>
	<#assign color = ""/>
	<p>
							${I18n.getMessage("ForumListing.numberOfUsersOnline", [ totalOnlineUsers, totalRegisteredOnlineUsers, totalAnonymousUsers ])}&nbsp;&nbsp;
			
						[ <span ${adminColor}>${I18n.getMessage("Administrator")}</span> ]&nbsp;[ <span ${moderatorColor}>${I18n.getMessage("Moderator")}</span> ]
						<br />
						${I18n.getMessage("ForumListing.mostUsersEverOnline", [ mostUsersEverOnline.getTotal(), mostUsersEverOnline.getDate()?string ])}									
						<br />
                        ${I18n.getMessage("ForumListing.newestUser")} <strong><a  style="color: #AA0000;" class="username-coloured" href="${JForumContext.encodeURL("/user/profile/${lastUser.id}")}">${lastUser.username}</a></strong>
                        <br/>
						${I18n.getMessage("ForumListing.connectedUsers")}: 
			
						<#list userSessions as us>
							<#if us.isAdmin()>
								<#assign color = adminColor/>
							<#elseif us.isModerator()>
								<#assign color = moderatorColor/>
							<#else>
								<#assign color = ""/>
							</#if>

								<a href="${JForumContext.encodeURL("/user/profile/${us.userId}")}"><span ${color}>${us.username}</span></a>&nbsp;
						</#list>
	
	</p>
	
	<h3>${I18n.getMessage("statistics")}</h3>
	<p>${I18n.getMessage("totalPosts")} <strong>${totalMessages}</strong> &#8226; ${I18n.getMessage("ForumListing.totalMembers")} <strong>${totalRegisteredUsers}</strong></p>

		


<#include "bottom.htm"/>
